<?php
/**
 * 新增判断
 */
require ('conn.php');
$u_name=$_POST['username'];
$u_email=$_POST['email'];
$u_sex=$_POST['sex'];
$u_province=$_POST['province'];
$u_hobby=$_POST['hobby'];
$u_hobby=implode('|',$u_hobby);
//var_dump($u_hobby);
$insert="insert into t_user value (null,'$u_name','$u_email','$u_sex','$u_province','$u_hobby')";
$query=mysqli_query($conn,$insert);
if (isset($query)){
    echo "<script>alert('新增成功！');location.href='index.php';</script>";
}else{
    echo "<script>alert('新增失败！');location.href='index.php';</script>";
}
